package com.example.dao;

import com.example.pojo.Emp1;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;
@Mapper
public interface Emp1Mapper {
    //查询所有

    //条件分页查询
    List<Emp1> list(String name, Short gender, LocalDate begin, LocalDate end);
    //批量删除数据
    void deleteById(List<Integer> ids);
    //根据id删除
    @Select("select * from emp1 where id=#{id}")
    Emp1 selectById(Integer id);
    //修改数据
    void update(Emp1 emp1);
    //添加数据
    @Insert("insert into emp1 ( username, name, gender, image, job, entrydate, dept_id, create_time, update_time) values (#{username}, #{name}, #{gender}, #{image}, #{job}, #{entrydate}, #{deptId}, #{createTime}, #{updateTime})")
    void insert(Emp1 emp1);
}
